#pragma once
#include "DXAMLCommon.h"


#include "XamlReader.h"
#include "XamlNode.h"
class XamlSchemaContext;
class XamlTextReaderSettings;
class XamlPullParser;
class XamlNode;


class XamlTextReader :
	public XamlReader
{
private: 
	XamlTextReader(const xshared_ptr<XamlSchemaContext> & spXamlSchemaContext, const xshared_ptr<XamlPullParser> spXamlPullParser);
public: 
	static HRESULT Create(xshared_ptr<XamlSchemaContext> spXamlSchemaContext, xshared_ptr<XamlTextReaderSettings> spXamlTextReaderSettings, XUINT32 cSource, XUINT8 * pSource, xshared_ptr<XamlTextReader> & spXamlTextReader);
	virtual ~XamlTextReader();
	virtual HRESULT Read();
	virtual const XamlNode & CurrentNode();
	virtual HRESULT GetSchemaContext(xshared_ptr<XamlSchemaContext> & outSchemaContext);
private: 
	xshared_ptr<XamlPullParser> m_spXamlPullParser;
	XamlNode m_currentXamlNode;
	xweak_ptr<XamlSchemaContext> m_spXamlSchemaContext;
};


